<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core">


    <h:head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Mercado Livre SistComp</title>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <link href="/mercadolivre/default.css" rel="stylesheet" type="text/css" />
    </h:head>

    <f:view>
        <h:body>
            <div id="top">
                <div id="logota"></div>
            </div>
            <div id="container">
                <div id="page">
                    <div id="menu">
                    </div>

                    <div id="contentTextNormal">
                        <f:view>                    
                            <h:messages style="font-size: 13px; color: white;"/>
                            <h:form>
                                <rich:panel>
                                    <f:facet name="header">
                                        <h:outputText value="Cadastrar Usuario"/>
                                    </f:facet>
                                    <h:panelGrid>
                                        <h:outputLabel value="Nome:"/>
                                        <h:inputText value="#{pessoaController.pessoa.nome}"/>
                                        <h:outputLabel value="Cpf:"/>
                                        <h:inputText value="#{pessoaController.pessoa.cpf}"/>
                                        <h:outputLabel value="Sexo:"/>
                                        <h:selectOneMenu id="ItemSexo" value="#{pessoaController.pessoa.sexo}">
                                            <f:selectItem
                                                itemValue="Masculino" itemLabel="Masculino"/>
                                            <f:selectItem
                                                itemValue="Feminino" itemLabel="Feminino"/>
                                        </h:selectOneMenu>
                                        <h:outputLabel value="Telefone:"/>
                                        <h:inputText value="#{pessoaController.pessoa.telefone}"/>
                                        <h:outputLabel value="Endereço:"/>
                                        <h:inputText value="#{pessoaController.pessoa.endereco}"/>
                                        <h:outputLabel value="Login:"/>
                                        <h:inputText value="#{pessoaController.pessoa.login}"/>
                                        <h:outputLabel value="Senha:"/>
                                        <h:inputSecret value="#{pessoaController.pessoa.senha}"/>
                                        <h:outputLabel value="Confirmar a Senha:"/>
                                        <h:inputSecret value="#{pessoaController.pessoaComparaSenha.senha}"/>

                                        <h:commandButton action="#{pessoaController.inserirPessoa()}"  value="Cadastrar"/>
                                        <h:commandButton action="/layout/templateNormal" value="Voltar" onclick="javascript:return(confirm('O cadastro do usuario não foi concluido, deseja voltar mesmo assim?'))"/>
                                    </h:panelGrid>
                                </rich:panel>
                            </h:form>

                        </f:view>
                    </div>

                </div>
            </div>
        </h:body>
    </f:view>
</ui:composition>